<!DOCTYPE html>
<html lang="zh-cmn-CN" ng-app="danmu.realtime" ng-controller="MainCtrl">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <link href="/static/bootstrap/css/bootstrap-theme.min.css" rel="stylesheet">
    <link href="/static/bootstrap/css/bootstrap.min.css" rel="stylesheet">
    <script src="/static/angular/angular.min.js"></script>
    <script src="/static/angular-ui-bootstrap/ui-bootstrap-tpls.js"></script>
    <link href="/manage.css" rel="stylesheet">
    <title>实时弹幕</title>
</head>

<body>
    <nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
        <div class="container-fluid">
            <div class="navbar-header"><a class="navbar-brand" href="#">实时弹幕</a></div>
        </div>
    </nav>
    <div class="container-fluid">
        <div class="row">
            <uib-alert type="danger" ng-show="haveError">错误{{err.code}}：{{err.desc}}；建议刷新页面。</uib-alert>
            <div class="col-sm-12 col-md-12 main">
                <uib-accordion close-others="false">
                    <uib-accordion-group heading="管理信息" is-open="true">
                        <div class="container">
                            <uib-alert type="danger" ng-show="!isLogin">务必先填入房间信息再进行管理。</uib-alert>
                            <uib-alert type="success" ng-show="isLogin">你选择了{{room}}房间</uib-alert>
                            <div class="list-group" ng-show="!isLogin">
                                <a href="#" class="list-group-item" ng-class="{active: room == roomS.id}" ng-repeat="roomS in roomList" ng-click="initRoom(roomS.id)">{{roomS.display}} ({{roomS.id}})</a>
                            </div>
                            <form ng-submit="enterRoom(password)" ng-show="!isLogin">
                                <div class="input-group">
                                    <input type="password" class="form-control" placeholder="房间密码" ng-model="password">
                                    <span class="input-group-btn">
                                        <button class="btn btn-success" type="submit">确认</button>
                                    </span>
                                </div>
                            </form>
                        </div>
                    </uib-accordion-group>
                    <uib-accordion-group heading="实时弹幕" is-open="true">
                        <div class="container">
                            <div ng-repeat="danmu in danmus track by danmu.socketId" style="margin-top: 5px; margin-right: 5px; display: inline-block">
                            <div class="btn-group" uib-dropdown>
                              <button id="split-button-{{$index}}" type="button" class="btn btn-primary" ng-click="deleteDanmu($index, danmu.id, '')">{{danmu.text}}</button>
                              <button type="button" class="btn btn-primary" uib-dropdown-toggle>
                                <span class="caret"></span>
                                <span class="sr-only">Split button!</span>
                              </button>
                              <ul uib-dropdown-menu role="menu" aria-labelledby="split-button-{{$index}}">
                                <li role="menuitem" class="disabled"><a href="#">{{danmu.hash}}</a></li>
                                <li class="divider"></li>
                                <li role="menuitem"><a href="#" ng-click="deleteDanmu($index, danmu.id, '')">删</a></li>
                                <li role="menuitem"><a href="#" ng-click="deleteDanmu($index, danmu.id, danmu.hash)">封</a></li>
                              </ul>
                            </div>
                            </div>
                        </div>
                    </uib-accordion-group>
                </uib-accordion>
            </div>
        </div>
    </div>
    <script>
    var serverVersion = "<%=version%>";
    </script>
    <script src="realtime.js"></script>
    <script src="/socket.io/socket.io.js"></script>
</body>

</html>
